package com.heima.dorm_system;

import java.util.ArrayList;

public class DormitoryBuilding {
    private String buildingName;
    private ArrayList<DormitoryRoom> rooms;

    public DormitoryBuilding(String buildingName, ArrayList<DormitoryRoom> rooms) {
        this.buildingName = buildingName;
        this.rooms = rooms;
    }
    public void add(DormitoryRoom room) {
        rooms.add(room);
        System.out.println(room.getRoomNumber()+"添加成功");
    }
    public void displayRooms(){
        for (int i = 0; i < rooms.size(); i++) {
            DormitoryRoom d = rooms.get(i);
            d.display();
        }
    }
}
